﻿namespace X2OPC.Core.DA
{
    using System;
    using System.Runtime.InteropServices;

    [ComVisible(true), Serializable, StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 2)]
    public class ServerStatus
    {
        ///服务器启动时间
        public long ftStartTime;

        /// <summary>
        /// 当前时间
        /// </summary>
        public long ftCurrentTime;

        /// <summary>
        /// 最后一次更新客户的时间
        /// </summary>
        public long ftLastUpdateTime;

        /// <summary>
        /// 当前服务器状态
        /// </summary>
        [MarshalAs(UnmanagedType.U4)]
        public OpcServerState eServerState;

        /// <summary>
        /// 本服务器实例所管理的组对象数
        /// </summary>
        public int dwGroupCount;

        /// <summary>
        /// 当前使用带宽的百分比，现在返回未知  0xFFFFFFFF
        /// </summary>
        public int dwBandWidth;

        /// <summary>
        /// 主版本号
        /// </summary>
        public short wMajorVersion;

        /// <summary>
        /// 副版本号
        /// </summary>
        public short wMinorVersion;

        /// <summary>
        /// 编译号
        /// </summary>
        public short wBuildNumber;

        /// <summary>
        /// 保留
        /// </summary>
        public short wReserved;

        /// <summary>
        ///  厂商信息
        /// </summary>
        [MarshalAs(UnmanagedType.LPWStr)]
        public string szVendorInfo;
    }
}
